Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add new collect_references recipe #57

Merged
merged 1 commit into from
Jun 9, 2024
Merged

Conversation

kylewlacy
Copy link
Member

This PR adds a new type of recipe, called collect_references. It takes a directory recipes, and bakes to the same value, then adds in a brioche-resources.d directory containing all the references from all descendent artifacts within (and then removes the reference from each artifact).

This effectively mirrors how brioche build -o <directory> works, and is specifically meant to improve situations where we need to create a self-contained tarfile of a Brioche artifact within Brioche itself. A real-world use-case can be seen in std.ociContainerImage, where we currently need to effectively manually do what this new recipe does in a messier way (see the expandResources function).

Also, because this feature is now built-in, it's easier to grab only the necessary resources for a recipe. Previously, building a container image from the rust_backend example would create a container image that was 122 MB (huge)! With a tweak to use the new collect_references recipe, this shrinks to only 7.3 MB, since we're no longer grabbing unnecessary references!

@kylewlacy kylewlacy merged commit f697d0b into main Jun 9, 2024
5 checks passed
@kylewlacy kylewlacy deleted the add-collect-references-recipe branch June 9, 2024 04:15
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant